package com.jtny.nytb.config.measurementunit.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.jtny.component.enums.GenericStatusEnum;
import com.jtny.nytb.config.measurementunit.dto.MeasurementUnitDTO;
import lombok.Data;

@Data
@ExcelIgnoreUnannotated
public class ExcelMeasurementUnitVO {

    /**
     * 计量单位分类
     */
    @ExcelProperty("计量单位分类")
    @ColumnWidth(30)
    private String typeName;

    /**
     * 计量单位编号
     */
    @ExcelProperty("计量单位编号")
    @ColumnWidth(30)
    private String code;

    /**
     * 计量单位名称
     */
    @ExcelProperty("计量单位名称")
    @ColumnWidth(30)
    private String name;

    public MeasurementUnitDTO toBuildDto() {
        MeasurementUnitDTO measurementUnitDTO = new MeasurementUnitDTO();
        measurementUnitDTO.setCode(code);
        measurementUnitDTO.setName(name);
        measurementUnitDTO.setStatus(GenericStatusEnum.NORMAL.getValue());
        return measurementUnitDTO;
    }
}
